1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.google.common.collect.testing;
18
19 import static com.google.common.collect.testing.Helpers.orderEntriesByKey;
20
21 import com.google.common.annotations.GwtCompatible;
22
23 import java.util.List;
24 import java.util.Map.Entry;
25 import java.util.SortedMap;
26
27
28
29
30
31
32 @GwtCompatible
33 public abstract class TestStringSortedMapGenerator extends TestStringMapGenerator
34 implements TestSortedMapGenerator<String, String> {
35 @Override
36 public Entry<String, String> belowSamplesLesser() {
37 return Helpers.mapEntry("!! a", "below view");
38 }
39
40 @Override
41 public Entry<String, String> belowSamplesGreater() {
42 return Helpers.mapEntry("!! b", "below view");
43 }
44
45 @Override
46 public Entry<String, String> aboveSamplesLesser() {
47 return Helpers.mapEntry("~~ a", "above view");
48 }
49
50 @Override
51 public Entry<String, String> aboveSamplesGreater() {
52 return Helpers.mapEntry("~~ b", "above view");
53 }
54
55 @Override
56 public Iterable<Entry<String, String>> order(List<Entry<String, String>> insertionOrder) {
57 return orderEntriesByKey(insertionOrder);
58 }
59
60 @Override
61 protected abstract SortedMap<String, String> create(Entry<String, String>[] entries);
62
63 @Override
64 public SortedMap<String, String> create(Object... entries) {
65 return (SortedMap<String, String>) super.create(entries);
66 }
67 }